<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      position: relative;
      width: 200px;
      height: 200px;
      background-color: pink;
      margin: 100px auto;
      text-align: center;
      line-height: 200px;
    }

    .box .click {
      position: absolute;
      top: 0;
      right: 0;
      margin-top: -90px;
    }

    .box .click:hover {
      cursor: pointer;
    }
  </style>
</head>

<body>
  <div class="box">广告
    <div class="click">×</div>
  </div>
  <script>
    const box = document.querySelector('.box')
    const click = document.querySelector('.click')
    click.addEventListener('click', function () {
      box.style.display = 'none'
    })
  </script>
</body>

</html>